<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>百度分享</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #share{
            width: 200px;
            height: 400px;
            background: #ccc;
            position: fixed;
            right: -200px;
            top: 50%;
            transform: translateY(-50%);
        }
        #word{
            width: 30px;
            height: 100px;
            background: lightcoral;
            position: absolute;
            top: 50%;
            left: -30px;
            transform: translateY(-50%);
        }

        #share2{
            width: 200px;
            height: 400px;
            background: #ccc;
            position: fixed;
            left: -200px;
            top: 50%;
            transform: translateY(-50%);
        }
        #word2{
            width: 30px;
            height: 100px;
            background: lightcoral;
            position: absolute;
            top: 50%;
            right: -30px;
            transform: translateY(-50%);
        }
    </style>
</head>
<body>
    <div id="share">
        <p id="word">点我看看</p>
    </div>

    <div id="share2">
        <p id="word2">点我看看</p>
    </div>
</body>
<script src="./common.js"></script>
<script src="./share.js"></script>
<script>
    /*
        侧栏广告：百度分享

            * 鼠标移入的时候：侧栏广告展示
            * 鼠标离开的时候：侧栏广告展示
    */

    var share = document.getElementById('share');
    var share2 = document.getElementById('share2');

    // share.onmouseover = function() {
    //     startMove(share, { 'right' : 0 });
    // }

    // share.onmouseout = function() {
    //     startMove(share, { 'right' : -200 });
    // }

    shareAd(share,{'right' : 0},{ 'right' : -200});//调用
    shareAd(share2,{'left' : 0},{ 'left' : -200});//调用
</script>
</html>